<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>检测用户输入字数</title>
        <script src="jquery-3.1.1.js"></script>
        <style>
            p{
                height: 20px;
            }
        </style>
    </head>
    <body>
        <div id="box">
            <p></p>
            <div class="wenb">
                <textarea rows="6" cols="80">

                </textarea>
            </div>
        </div>
    </body>
</html>
<script>
    $('textarea').change(function(){
        $('p').html($(this).val().length+'字')
    })
</script>